<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
  <head>
    <html:base />
    
    <title>login.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/jquery-1.3.2.min-vsdoc.js"></script>
  	<script type="text/javascript">
  	        
	 		$(document).ready(function(){
  			$("#mybt").click(function(){
  				alert("=====");
  				var s1=$("#uname").val();
  				var s2=$("#passwd").val();
  				alert(s1);
  				alert(s2);
  				$.post("login.do?op=check",{"ubean.uname":s1,"ubean.passwd":s2},callbackfun,"json");
  			});
  		});
  		function callbackfun(data){
  			alert(data.length);
  			alert(data[0].uname);
  			var str="<table width='550' border='1' cellpadding='1' cellspacing='0'>"+
  					 "<tr align='center' bordercolor='#FFFFFF' bgcolor='#CCCCCC'>"+
    				 "<td>姓名</td>"+
    				 "<td>密码</td>"+
    				 "<td>操作</td>"+	
  					 "</tr>"
  					for(var i=0;i<data.length;i++){
  					  str+="<tr>"
    					+"<td>"+data[i].uname+"</td>"
						+"<td>"+data[i].passwd+"</td>"
						+"<td>删除 修改</td></tr>";
  					   
  					}
  					
				str+="</table>";
  			
  				$("#mydata").html(str);
  		}
  		
  		/* 
  		$(document).ready(function(){
			$('#mybt').submit(function(){
					$('#mybt').ajaxSubmit({
							success:function(msg){				
							alert(msg);				
						}
		
					});
				return false;
			});	
	
		});
		*/
  		function callback(data){
  			alert(data);
  		}
  	</script>
  </head>
  
  <body>
   数据列表 <br>
   <div id="mydata">
   	
   </div>
    <html:form action="login.do?op=check" method="post" styleId="form1">
    	姓名:<html:text property="ubean.uname" styleId="uname"/><br>	
    	密码:<html:password property="ubean.passwd" styleId="passwd" /><br>
    	<html:button property="" value="提交" styleId="mybt"/>	
    </html:form>
  </body>
</html:html>
